-------------------------------------------------------------------------------
      name:  <unnamed>
       log:  anes2008.out
  log type:  text
 opened on:  30 Apr 2015, 16:09:20

.  set more off;

. /* Original command to extract data from the full 2008 ANES file 
> 
> use V083097 V083098a V083098b V083101d V083101f V083102d V083102f
> V083103 V083178d V083178f V083179d V083179f  
> using anes_timeseries_2008.dta;
> */
> 
> /* read subset of ANES 2008 Data */
> 
> insheet using anes2008.csv, comma names case;
(12 vars, 2322 obs)

.  /* create party id variable */
> gen partyid7=0 if V083097==1 & V083098a==1;
(1742 missing values generated)

. replace partyid7=1  if V083097==1 & V083098a==5;
(393 real changes made)

. replace partyid7=2  if V083097==3 & V083098b==5;
(336 real changes made)

. replace partyid7=3  if V083097==3 & V083098b==3;
(171 real changes made)

. replace partyid7=4  if V083097==3 & V083098b==1;
(193 real changes made)

. replace partyid7=5  if V083097==2 & V083098a==5;
(200 real changes made)

. replace partyid7=6  if V083097==2 & V083098a==1;
(230 real changes made)

. /* create 3-point party ID scale */
> 
> gen partyid3=0 if V083097==1;
(1345 missing values generated)

. replace partyid3=2 if V083097==2;
(432 real changes made)

. replace partyid3=1 if V083097>=3;
(878 real changes made)

. gen dem=(partyid3==0);

. gen rep=(partyid3==2);

. gen ind=0 if dem==1 & rep==1;
(2322 missing values generated)

. replace ind=1 if V083097>=3 & V083097<=5;
(878 real changes made)

. /* create bush knowledgeable variable */
> gen bushkno=6-V083179d if V083179d>0 & V083179d<7;
(1152 missing values generated)

. replace bushkno=5 if V083178d==1;
(103 real changes made)

. replace bushkno=4 if V083178d==2;
(387 real changes made)

. replace bushkno=2 if V083178d==3;
(367 real changes made)

. replace bushkno=1 if V083178d==4;
(260 real changes made)

. /* create bush honesty variable */
> gen bushhon=6-V083179f if V083179f>0 & V083179f<7;
(1164 missing values generated)

. replace bushhon=5 if V083178f==1;
(79 real changes made)

. replace bushhon=4 if V083178f==2;
(270 real changes made)

. replace bushhon=2 if V083178f==3;
(375 real changes made)

. replace bushhon=1 if V083178f==4;
(379 real changes made)

. tab bushhon if partyid7>=4 & partyid7<=6;

    bushhon |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |         65       10.48       10.48
          2 |        124       20.00       30.48
          3 |        100       16.13       46.61
          4 |        231       37.26       83.87
          5 |        100       16.13      100.00
------------+-----------------------------------
      Total |        620      100.00

. /* create mccain knowledgeable variable */
> gen mccainkno=6-V083102d if V083102d>0 & V083102d<7;
(1161 missing values generated)

. replace mccainkno=5 if V083101d==1;
(231 real changes made)

. replace mccainkno=4 if V083101d==2;
(587 real changes made)

. replace mccainkno=2 if V083101d==3;
(214 real changes made)

. replace mccainkno=1 if V083101d==4;
(77 real changes made)

. /* create mccain honesty variable */
> gen mccainhon=6-V083102f if V083102f>0 & V083102f<7;
(1200 missing values generated)

. replace mccainhon=5 if V083101f==1;
(164 real changes made)

. replace mccainhon=4 if V083101f==2;
(415 real changes made)

. replace mccainhon=2 if V083101f==3;
(345 real changes made)

. replace mccainhon=1 if V083101f==4;
(153 real changes made)

. /* do trait cross-tabs for Bush and McCain */
> 
> tab bushhon mccainhon if partyid7>=4 & partyid7<=6, cell;

+-----------------+
| Key             |
|-----------------|
|    frequency    |
| cell percentage |
+-----------------+

           |                       mccainhon
   bushhon |         1          2          3          4          5 |     Total
-----------+-------------------------------------------------------+----------
         1 |        15         13         10         16          9 |        63 
           |      2.45       2.13       1.64       2.62       1.47 |     10.31 
-----------+-------------------------------------------------------+----------
         2 |         2         27         20         60         15 |       124 
           |      0.33       4.42       3.27       9.82       2.45 |     20.29 
-----------+-------------------------------------------------------+----------
         3 |         3          6         35         41         11 |        96 
           |      0.49       0.98       5.73       6.71       1.80 |     15.71 
-----------+-------------------------------------------------------+----------
         4 |         0         10         15        139         65 |       229 
           |      0.00       1.64       2.45      22.75      10.64 |     37.48 
-----------+-------------------------------------------------------+----------
         5 |         0          3          4         24         68 |        99 
           |      0.00       0.49       0.65       3.93      11.13 |     16.20 
-----------+-------------------------------------------------------+----------
     Total |        20         59         84        280        168 |       611 
           |      3.27       9.66      13.75      45.83      27.50 |    100.00 


. tab bushkno mccainkno if partyid7>=4 & partyid7<=6, cell;

+-----------------+
| Key             |
|-----------------|
|    frequency    |
| cell percentage |
+-----------------+

           |                       mccainkno
   bushkno |         1          2          3          4          5 |     Total
-----------+-------------------------------------------------------+----------
         1 |         3          7         13         19          4 |        46 
           |      0.48       1.13       2.10       3.07       0.65 |      7.43 
-----------+-------------------------------------------------------+----------
         2 |         4         13         13         62         21 |       113 
           |      0.65       2.10       2.10      10.02       3.39 |     18.26 
-----------+-------------------------------------------------------+----------
         3 |         1          6         22         60         19 |       108 
           |      0.16       0.97       3.55       9.69       3.07 |     17.45 
-----------+-------------------------------------------------------+----------
         4 |         1          7         10        164         87 |       269 
           |      0.16       1.13       1.62      26.49      14.05 |     43.46 
-----------+-------------------------------------------------------+----------
         5 |         1          0          3         30         49 |        83 
           |      0.16       0.00       0.48       4.85       7.92 |     13.41 
-----------+-------------------------------------------------------+----------
     Total |        10         33         61        335        180 |       619 
           |      1.62       5.33       9.85      54.12      29.08 |    100.00 


. /* create variable for Iraq attitudes */
> 
> gen iraqworth=(V083103==1) if V083103==1 | V083103==5;
(71 missing values generated)

. tab bushhon iraqworth if partyid7>=4 & partyid7<=6, col;

+-------------------+
| Key               |
|-------------------|
|     frequency     |
| column percentage |
+-------------------+

           |       iraqworth
   bushhon |         0          1 |     Total
-----------+----------------------+----------
         1 |        62          3 |        65 
           |     20.13       1.01 |     10.74 
-----------+----------------------+----------
         2 |        91         30 |       121 
           |     29.55      10.10 |     20.00 
-----------+----------------------+----------
         3 |        53         46 |        99 
           |     17.21      15.49 |     16.36 
-----------+----------------------+----------
         4 |        87        136 |       223 
           |     28.25      45.79 |     36.86 
-----------+----------------------+----------
         5 |        15         82 |        97 
           |      4.87      27.61 |     16.03 
-----------+----------------------+----------
     Total |       308        297 |       605 
           |    100.00     100.00 |    100.00 


. /* outsheet V083097 V083098a V083098b V083101d V083101f V083102d V083102f
> V083103 V083178d V083178f V083179d V083179f using anes2008.csv, comma
> nolabel replace; */
> 
> log close;
      name:  <unnamed>
       log:  anes2008.out
  log type:  text
 closed on:  30 Apr 2015, 16:09:20
-------------------------------------------------------------------------------
